package org.acghub.mtdb.core;

import com.alibaba.fastjson2.JSONObject;
import org.bson.Document;

/**
 * @author zhouhe
 */
public interface TableMarshal<K, V> {
    V newValue();

    JSONObject marshalJsonKey(K key);

    JSONObject marshalJsonValue(V value);

    Document marshalDocumentKey(K key);

    Document marshalDocumentValue(V value);

    K unmarshalJsonKey(JSONObject reader);

    V unmarshalJsonValue(JSONObject reader);

    K unmarshalDocumentKey(Document reader);

    V unmarshalDocumentValue(Document reader);

}
